package com.enjoyor.soa.traffic.rest.tsms.dubbo.impl;

import java.util.Date;
import org.springframework.stereotype.Component;

import com.alibaba.dubbo.config.annotation.Reference;
import com.enjoyor.soa.traffic.api.dto.tsms.SchemeInfoDto;
import com.enjoyor.soa.traffic.api.service.dubbo.tsms.IDubboSchemeInfoService;
import com.enjoyor.soa.traffic.rest.tsms.dubbo.ISchemeInfoConsumeService;
import com.enjoyor.soa.traffic.util.helper.TimeHelper;
import com.enjoyor.soa.traffic.util.pojo.Page;
import com.enjoyor.soa.traffic.util.pojo.ResultPojo;
@Component
public class SchemeInfoConsumeService implements ISchemeInfoConsumeService{
	
	@Reference(version = "1.0.0", timeout = 10000) 
	//@Reference(version = "1.0.0", timeout = 10000, url="dubbo://192.168.56.8:21241")
	private IDubboSchemeInfoService iDubboSchemeInfoService;
	
	@Override
	public ResultPojo getSchemeInfoPage(Page page, String schemeId, String schemeName, String schemeBeginDate,
			String schemeEndDate, String schemeRankId, String schemeStatusId) {
		// TODO Auto-generated method stub
		ResultPojo resultPojo = new ResultPojo();
		resultPojo = iDubboSchemeInfoService.getSchemeInfoPage(page, schemeId, schemeName, schemeBeginDate,
				schemeEndDate, schemeRankId, schemeStatusId);
		return resultPojo;
	}

	@Override
	public ResultPojo getSchemeInfoList(String schemeId, String schemeName, String schemeBeginDate,
			String schemeEndDate, String schemeRankId, String schemeStatusId, Boolean isFull) {
		// TODO Auto-generated method stub
		ResultPojo resultPojo = new ResultPojo();
		resultPojo = iDubboSchemeInfoService.getSchemeInfoList(schemeId, schemeName, schemeBeginDate, schemeEndDate,
				schemeRankId, schemeStatusId, isFull);
		return resultPojo;
	}

	@Override
	public ResultPojo insertSchemeInfo(SchemeInfoDto schemeInfoDto, String personName) {
		// TODO Auto-generated method stub
		ResultPojo resultPojo = new ResultPojo();
		resultPojo = iDubboSchemeInfoService.insertSchemeInfo(schemeInfoDto, personName);
		return resultPojo;
	}

	@Override
	public ResultPojo updateSchemeInfo(SchemeInfoDto schemeInfoDto, String personName) {
		// TODO Auto-generated method stub
		ResultPojo resultPojo = new ResultPojo();
		resultPojo = iDubboSchemeInfoService.updeteSchemeInfo(schemeInfoDto, personName);
		return resultPojo;
	}

	@Override
	public ResultPojo deleteSchemeInfoById(String schemeId, String personName) {
		// TODO Auto-generated method stub
		ResultPojo resultPojo = new ResultPojo();
		resultPojo = iDubboSchemeInfoService.deleteSchemeInfo(schemeId, personName);
		return resultPojo;
	}

	@Override
	public ResultPojo commitSchemeInfo(String schemeId, String personName) {
		// TODO Auto-generated method stub
		ResultPojo resultPojo = new ResultPojo();
		resultPojo = iDubboSchemeInfoService.submitSchemeInfo(schemeId, personName);
		return resultPojo;
	}

	@Override
	public ResultPojo auditSchemeInfo(String schemeId,String schemeStatusId, String checkIdea,String personName) {
		// TODO Auto-generated method stub
		ResultPojo resultPojo = new ResultPojo();
		resultPojo = iDubboSchemeInfoService.auditSchemeInfo(schemeId,schemeStatusId, checkIdea ,personName);
		return resultPojo;
	}

	@Override
	public ResultPojo getSchemeForWeek(String schemeId, String schemeBeginDate, String schemeEndDate, String executeStatusId, 
			String driverPoliceId, String beforeLicensePlate) {
		// TODO Auto-generated method stub
		ResultPojo resultPojo = new ResultPojo();
		resultPojo = iDubboSchemeInfoService.getSchemeForWeek(schemeId, schemeBeginDate, schemeEndDate, executeStatusId, 
				driverPoliceId, beforeLicensePlate);
		return resultPojo;
	}
	
	@Override
	public ResultPojo editSchemeWaitStatus(String executeTaskId, String isWaitExecute, String personName) {
		// TODO Auto-generated method stub
		ResultPojo resultPojo = new ResultPojo();
		resultPojo = iDubboSchemeInfoService.editSchemeWaitStatus(executeTaskId, isWaitExecute, personName);
		return resultPojo;
	}

	@Override
	public ResultPojo getPreviewSchemeList(String schemeBeginDate, String schemeEndDate) {
		// TODO Auto-generated method stub
		System.out.print("接口开始时间："+TimeHelper.dateToString(new Date(),"yyyy-MM-dd'T'HH:mm:ss.SSSZ"));
		ResultPojo resultPojo = new ResultPojo();
		resultPojo = iDubboSchemeInfoService.getPreviewSchemeList(schemeBeginDate, schemeEndDate);
		System.out.print("接口结束时间："+TimeHelper.dateToString(new Date(),"yyyy-MM-dd'T'HH:mm:ss.SSSZ"));
		return resultPojo;
	}
	
	@Override
	public ResultPojo getExecuteStatusCollect(String taskId, String schemeId, String executeTaskId, 
			String executeDate) {
		return iDubboSchemeInfoService.getExecuteStatusCollect(taskId, schemeId, executeTaskId, executeDate);
	}
	
	@Override
	public ResultPojo getRealExecuteTime(String taskId, String schemeId, String executeTaskId, 
			String executeDate) {
		return iDubboSchemeInfoService.getRealExecuteTime(taskId, schemeId, executeTaskId, executeDate);
	}
}
